Skip to content

client: add OslcRequestParams and graph accumulation#468

Draft
Copilot wants to merge 14 commits into
mainfrom
copilot/merge-oslcclient-with-oslcrestclient
Draft

client: add OslcRequestParams and graph accumulation#468
Copilot wants to merge 14 commits into
mainfrom
copilot/merge-oslcclient-with-oslcrestclient

Conversation

Copilot AI commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

Addresses #325: Enables configurable request parameters and graph accumulation in OslcClient, properly resolving #19 and #204 (header overwriting issues).

Changes

  • OslcRequestParams class — Configures Accept, Content-Type, OSLC-Core-Version, and custom headers. Supports merge semantics for per-request overrides.

    • Pre-built configs: Default, RdfXmlOnly, TurtleOnly
    • Fluent Builder() API
  • Graph accumulationEnableGraphAccumulation() / DisableGraphAccumulation() for discovery phase workflows where responses should merge into a single graph

  • Per-request parameter overrides — New overloads for GetResourceAsync and CreateResourceAsync accepting OslcRequestParams

  • DefaultRequestParams property — Set globally in constructor or per-request

Usage

// Constructor-level defaults
var client = new OslcClient(logger, OslcRequestParams.RdfXmlOnly);

// Per-request override
var customParams = OslcRequestParams.Builder()
    .WithAccept("text/turtle")
    .WithHeader("X-Custom", "value")
    .Build();
await client.GetResourceAsync<ServiceProvider>(uri, null, customParams);

// Discovery with graph accumulation
var graph = client.EnableGraphAccumulation();
await client.GetResourceAsync<ServiceProviderCatalog>(catalogUri);
await client.GetResourceAsync<ServiceProvider>(spUri);
// graph now contains merged triples from both responses

Notes

  • OslcRestClient remains deprecated (since 0.5.0)
  • 21 new unit tests added
  • All existing APIs unchanged
Original prompt

This section details on the original issue you should resolve

<issue_title>Merge OslcClient and OslcRestClient</issue_title>
<issue_description>- [ ] Ensure #19 and #204 are solved properly. I am thinking of OslcRequestParams that we pre-set in the library, allow the user to set in the ctor, or to override on a per-request basis (mainly, to request/specify certain types, e.g. request only RDF/XML for root services or POST RDF/XML-ABBREV in some special cases)

  • Allow access of both unmarshalled POCOs as well as access to the raw response graph.
  • Allow the client to be set to accumulate the responses in a single graph - useful for the initial discovery phase.</issue_description>

<agent_instructions>OslcClient should remain. Increase test coverage during the join.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@berezovskyi OslcRestClient is largely deprecated since 0.5.0 - OslcClient is the primary client.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 29, 2025
@coderabbitai

coderabbitai Bot commented Nov 29, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 2 commits November 29, 2025 19:28
Co-authored-by: berezovskyi <64734+berezovskyi@users.noreply.github.com>
Co-authored-by: berezovskyi <64734+berezovskyi@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge OslcClient and OslcRestClient with enhancements Add OslcRequestParams and graph accumulation support to OslcClient Nov 29, 2025
Copilot AI requested a review from berezovskyi November 29, 2025 19:37
@codecov

codecov Bot commented Nov 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.93%. Comparing base (fc393b5) to head (dee7490).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   51.41%   51.93%   +0.51%     
==========================================
  Files         174      175       +1     
  Lines       10401    10505     +104     
  Branches     1057     1079      +22     
==========================================
+ Hits         5348     5456     +108     
+ Misses       4793     4784       -9     
- Partials      260      265       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +189 to +194
return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent("<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"></rdf:RDF>",
Encoding.UTF8, "application/rdf+xml"),
RequestMessage = req
});
Comment on lines +229 to +234
return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent("<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"></rdf:RDF>",
Encoding.UTF8, "application/rdf+xml"),
RequestMessage = req
});
@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: C#

C# / dotnet/cobertura

The overall coverage in the branch is 56%. The coverage in the branch is 55%.

Show a code coverage summary of the most impacted files.
File fc393b5 dee7490 +/-
/home/runner/wo...NetRdfHelper.cs 72% 72% 0%
/home/runner/wo...c/OslcClient.cs 38% 49% +11%
/home/runner/wo...equestParams.cs 0% 100% +100%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@berezovskyi berezovskyi changed the title Add OslcRequestParams and graph accumulation support to OslcClient client: add OslcRequestParams and graph accumulation Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge OslcClient and OslcRestClient

2 participants